<?php
declare(strict_types=1);

class Database
{
    private static ?object $instance = null;
    public PDO $connection;
    private string $dsn = 'mysql:host=localhost;dbname=lks';
    private string $user = 'lks';
    private string $password = 'lks123';
    public function __construct()
    {
        $this->connection = new PDO($this->dsn, $this->user, $this->password);
    }
    public static function getInstance()
    {
        if (self::$instance === null) self::$instance = new self();
        return self::$instance->connection;
    }
}